using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
namespace MRSite.Entity
{
    /// <summary>
    /// 交易市场
    /// </summary>
    [Table(Name = "bi_market")]
    public class BiMarket : Entity
    {

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }


        /// <summary>
        /// 交易单号
        /// </summary>
        [Column(Name = "trade_no")]
        public String trade_no { get; set; }


        /// <summary>
        ///   卖家用户Id
        /// </summary>
        [Column(Name = "memberid")]
        public int memberid { get; set; }


        /// <summary>
        /// 卖家用户名
        /// </summary>
        [Column(Name = "username")]
        public String username { get; set; }

        /// <summary>
        /// 价格
        /// </summary>
        [Column(Name = "price")]
        public Decimal price { get; set; }

        /// <summary>
        /// 卖出数量 = 给买家的数量 + 手续费
        /// </summary>
        [Column(Name = "shuliang")]
        public Decimal shuliang { get; set; }

        /// <summary>
        ///提现实到金额
        /// </summary>
        [Column(Name = "txamount")]
        public Decimal txamount { get; set; }


        /// <summary>
        ///实发数量  实际给买家的数量
        /// </summary>
        [Column(Name = "sfnum")]
        public Decimal sfnum { get; set; }

        /// <summary>
        /// 卖家 手续费 （换算成金额）
        /// </summary>
        [Column(Name = "handlingfee")]
        public Decimal handlingfee { get; set; }

        /// <summary>
        /// 卖家 费率
        /// </summary>
        [Column(Name = "rates")]
        public double rates { get; set; }

        /// <summary>
        /// 买家手续费  
        /// </summary>
        [Column(Name = "cxf_fee")]
        public Decimal cxf_fee { get; set; }

        /// <summary>
        /// 买家 费率
        /// </summary>
        [Column(Name = "cxf_rates")]
        public double cxf_rates { get; set; }


        /// <summary>
        /// 买家用户id
        /// </summary>
        [Column(Name = "buy_userid")]
        public int buy_userid { get; set; }


        /// <summary>
        ///   买家用户名
        /// </summary>
        [Column(Name = "buy_username")]
        public String buy_username { get; set; }



        /// <summary>
        ///
        /// </summary>
        [Column(Name = "addtime", IsDbGenerated = true)]
        public DateTime addtime { get; set; }

        /// <summary>
        ///0待处理,1已锁定,2已打款；3成功；4作废
        /// </summary>
        [Column(Name = "status")]
        public int status { get; set; }

        /// <summary>
        /// 提现类别 1可用共建值；2共建值：其他共建值扣除顺序为锁仓共建值、网点奖励共建值、首购共建值、养老共建值； 
        /// </summary>
        [Column(Name = "txtype")]
        public int txtype { get; set; }

        /// <summary>
        /// 匹配类别 1系统匹配 0会员之间匹配
        /// </summary>
        [Column(Name = "pptype")]
        public int pptype { get; set; }

        /// <summary>
        /// 发起人类别 1卖出 2买入
        /// </summary>
        [Column(Name = "type")]
        public int type { get; set; }



        /// <summary>
        /// 锁定时间
        /// </summary>
        [Column(Name = "locktime")]
        public DateTime? locktime { get; set; }

        /// <summary>
        /// 打款时间
        /// </summary>
        [Column(Name = "paytime")]
        public DateTime? paytime { get; set; }


        /// <summary>
        ///处理时间
        /// </summary>
        [Column(Name = "checktime")]
        public DateTime? checktime { get; set; }

        /// <summary>
        /// 作废时间
        /// </summary>
        [Column(Name = "canceltime")]
        public DateTime? canceltime { get; set; }

        /// <summary>
        /// 收款时间/完成时间
        /// </summary>
        [Column(Name = "recive_time")]
        public DateTime? recive_time { get; set; }




        /// <summary>
        ///
        /// </summary>
        [Column(Name = "remark")]
        public String remark { get; set; }

        /// <summary>
        /// 打款凭证
        /// </summary>
        [Column(Name = "dkimg")]
        public string dkimg { get; set; }

        /// <summary>
        /// 投诉内容
        /// </summary>
        [Column(Name = "ts_content")]
        public string ts_content { get; set; }

        /// <summary>
        /// 投诉处理状态 1未处理；2处理成功； 
        /// </summary>
        [Column(Name = "ts_status")]
        public int ts_status { get; set; }

        /// <summary>
        ///  投诉时间
        /// </summary>
        [Column(Name = "ts_addtime")]
        public DateTime? ts_addtime { get; set; }

        /// <summary>
        ///  投诉处理时间
        /// </summary>
        [Column(Name = "ts_passtime")]
        public DateTime? ts_passtime { get; set; }

        /// <summary>
        /// 投诉处理回复内容 
        /// </summary>
        [Column(Name = "ts_remark_admin")]
        public string ts_remark_admin { get; set; }


        /// <summary>
        /// 提现帐户类型
        /// </summary>
        [Column(Name = "gathering")]
        public String gathering { get; set; }

        /// <summary>
        /// 微信/支付宝帐号
        /// </summary>
        [Column(Name = "wxaccount")]
        public String wxaccount { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [Column(Name = "realname")]
        public String realname { get; set; }

        /// <summary>
        /// 银行名
        /// </summary>
        [Column(Name = "bankname")]
        public String bankname { get; set; }

        /// <summary>
        /// 银行帐号
        /// </summary>
        [Column(Name = "bankaccount")]
        public String bankaccount { get; set; }

        /// <summary>
        /// 开户名
        /// </summary>
        [Column(Name = "account")]
        public String account { get; set; }

        /// <summary>
        /// 银行支行
        /// </summary>
        [Column(Name = "zhihang")]
        public String zhihang { get; set; }

        /// <summary>
        ///  买家对应订单号id
        /// </summary>
        [Column(Name = "buy_orderid")]
        public int buy_orderid { get; set; }

        /// <summary>
        /// 卖家对应订单号id
        /// </summary>
        [Column(Name = "sell_orderid")]
        public int sell_orderid { get; set; }


        /// <summary>
        /// 扣除可用共建值  
        /// </summary>
        [Column(Name = "kc_golds")]
        public Decimal kc_golds { get; set; }

        /// <summary>
        /// 扣除锁仓共建值  
        /// </summary>
        [Column(Name = "kc_golds_sc")]
        public Decimal kc_golds_sc { get; set; }

        /// <summary>
        /// 扣除网点奖励共建值
        /// </summary>
        [Column(Name = "kc_servicejl")]
        public Decimal kc_servicejl { get; set; }

        /// <summary>
        /// 扣除首购共建值
        /// </summary>
        [Column(Name = "kc_sgjl")]
        public Decimal kc_sgjl { get; set; }

        /// <summary>
        /// 扣除养老共建值
        /// </summary>
        [Column(Name = "kc_pension")]
        public Decimal kc_pension { get; set; }


        private EntityRef<Customer> _member;

        /// <summary>
        /// 
        /// </summary>
        [Association(Storage = "_member", ThisKey = "memberid", OtherKey = "id")]
        public Customer MemberItem
        {
            get { return this._member.Entity; }
            set { this._member.Entity = value; }
        }
    }
}

